Don't set h_errno on MS-Windows except in gethostbyname.
authorEli Zaretskii <eliz@gnu.org>
Sat, 16 Feb 2013 11:08:49 +0000 (13:08 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 16 Feb 2013 11:08:49 +0000 (13:08 +0200)
commit512dc5e05d085cf3f6e3fc767bd8f818543146fc
treee3f0b7c648fc27802a4d90c55e26d7bb617c3736
parentc131f2fc29801a7cd54f770dcdfbc515ebf52c17
Don't set h_errno on MS-Windows except in gethostbyname.

See http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00293.html
and the following discussion for the details.

 src/w32.c (set_errno): Reset h_errno and don't set it to any other
 value.  Set errno instead.
 (check_errno): Reset h_errno.
 (sys_socket, socket_to_fd, sys_bind, sys_connect)
 (sys_gethostname, sys_getservbyname, sys_getpeername)
 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
 h_errno.
 (sys_gethostbyname): Set h_errno only errors detected.
src/ChangeLog
src/w32.c